#!/usr/local/bin/bash

if [ $# -lt 4 ]; then
	echo "Usage: $0 start stop filename size [rand]"
	exit 1
fi

	
START=$1
STOP=$2
FILE=$3
SIZE=$4
RAND=$5

GENERATOR=/dev/zero
if [ "$RAND" = "rand" ]; then
	GENERATOR=/dev/urandom
fi

while [ $START -le $STOP ]
do
	dd if=$GENERATOR of=/home/filedisk/$FILE$START bs=$SIZE count=1
	START=`expr $START + 1`
done

